package 快速排序;

import java.util.Scanner;

public class Main {
    static int N = 100010, n;
    static int[] a = new int[N];

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        n = in.nextInt();
        for (int i = 0; i < n; i++) {
            a[i] = in.nextInt();
        }
        qSort(0, n - 1);
        for (int i = 0; i < n; i++) {
            System.out.print(a[i] + " ");
        }
    }

    private static void qSort(int l, int r) {
        if (l >= r) {
            return;
        }
        int x = a[l + r >> 1], i = l - 1, j = r + 1;
        while (i < j) {
            do {
                i++;
            } while (a[i] < x);
            do {
                j--;
            } while (a[j] > x);
            if (i < j) {
                swap(i, j);
            }
        }
        qSort(l, j);
        qSort(j + 1, r);
    }

    private static void swap(int i, int j) {
        int t = a[i];
        a[i] = a[j];
        a[j] = t;
    }
}